package net.techwatch.spring.roo.web;

privileged aspect EmployeeListController_Roo_Controller {
    
    @org.springframework.web.bind.annotation.RequestMapping(value = "employeelist", method = org.springframework.web.bind.annotation.RequestMethod.POST)    
    public java.lang.String EmployeeListController.create(@org.springframework.web.bind.annotation.ModelAttribute("employeelist") net.techwatch.spring.roo.domain.EmployeeList employeelist, org.springframework.validation.BindingResult result) {    
        if (employeelist == null) throw new IllegalArgumentException("A employeelist is required");        
        for(javax.validation.ConstraintViolation<net.techwatch.spring.roo.domain.EmployeeList> constraint : javax.validation.Validation.buildDefaultValidatorFactory().getValidator().validate(employeelist)) {        
            result.rejectValue(constraint.getPropertyPath(), null, constraint.getMessage());            
        }        
        if (result.hasErrors()) {        
            return "employeelist/create";            
        }        
        employeelist.persist();        
        return "redirect:/employeelist/" + employeelist.getId();        
    }    
    
    @org.springframework.web.bind.annotation.RequestMapping(value = "employeelist/form", method = org.springframework.web.bind.annotation.RequestMethod.GET)    
    public java.lang.String EmployeeListController.createForm(org.springframework.ui.ModelMap modelMap) {    
        modelMap.addAttribute("employeelist", new net.techwatch.spring.roo.domain.EmployeeList());        
        modelMap.addAttribute("employees", net.techwatch.spring.roo.domain.Employee.findAllEmployees());        
        return "employeelist/create";        
    }    
    
    @org.springframework.web.bind.annotation.RequestMapping(value = "employeelist/{id}", method = org.springframework.web.bind.annotation.RequestMethod.GET)    
    public java.lang.String EmployeeListController.show(@org.springframework.web.bind.annotation.PathVariable("id") Long id, org.springframework.ui.ModelMap modelMap) {    
        if (id == null) throw new IllegalArgumentException("An Identifier is required");        
        modelMap.addAttribute("employeelist", net.techwatch.spring.roo.domain.EmployeeList.findEmployeeList(id));        
        return "employeelist/show";        
    }    
    
    @org.springframework.web.bind.annotation.RequestMapping(value = "employeelist", method = org.springframework.web.bind.annotation.RequestMethod.GET)    
    public java.lang.String EmployeeListController.list(org.springframework.ui.ModelMap modelMap) {    
        modelMap.addAttribute("employeelists", net.techwatch.spring.roo.domain.EmployeeList.findAllEmployeeLists());        
        return "employeelist/list";        
    }    
    
    @org.springframework.web.bind.annotation.RequestMapping(method = org.springframework.web.bind.annotation.RequestMethod.PUT)    
    public java.lang.String EmployeeListController.update(@org.springframework.web.bind.annotation.ModelAttribute("employeelist") net.techwatch.spring.roo.domain.EmployeeList employeelist, org.springframework.validation.BindingResult result) {    
        if (employeelist == null) throw new IllegalArgumentException("A employeelist is required");        
        for(javax.validation.ConstraintViolation<net.techwatch.spring.roo.domain.EmployeeList> constraint : javax.validation.Validation.buildDefaultValidatorFactory().getValidator().validate(employeelist)) {        
            result.rejectValue(constraint.getPropertyPath(), null, constraint.getMessage());            
        }        
        if (result.hasErrors()) {        
            return "employeelist/update";            
        }        
        employeelist.merge();        
        return "redirect:/employeelist/" + employeelist.getId();        
    }    
    
    @org.springframework.web.bind.annotation.RequestMapping(value = "employeelist/{id}/form", method = org.springframework.web.bind.annotation.RequestMethod.GET)    
    public java.lang.String EmployeeListController.updateForm(@org.springframework.web.bind.annotation.PathVariable("id") java.lang.Long id, org.springframework.ui.ModelMap modelMap) {    
        if (id == null) throw new IllegalArgumentException("An Identifier is required");        
        modelMap.addAttribute("employeelist", net.techwatch.spring.roo.domain.EmployeeList.findEmployeeList(id));        
        modelMap.addAttribute("employees", net.techwatch.spring.roo.domain.Employee.findAllEmployees());        
        return "employeelist/update";        
    }    
    
    @org.springframework.web.bind.annotation.RequestMapping(value = "employeelist/{id}", method = org.springframework.web.bind.annotation.RequestMethod.DELETE)    
    public java.lang.String EmployeeListController.delete(@org.springframework.web.bind.annotation.PathVariable("id") java.lang.Long id) {    
        if (id == null) throw new IllegalArgumentException("An Identifier is required");        
        net.techwatch.spring.roo.domain.EmployeeList.findEmployeeList(id).remove();        
        return "redirect:/employeelist";        
    }    
    
    @org.springframework.web.bind.annotation.InitBinder    
    public void EmployeeListController.initBinder(org.springframework.web.bind.WebDataBinder binder) {    
        binder.registerCustomEditor(java.util.Date.class, new org.springframework.beans.propertyeditors.CustomDateEditor(new java.text.SimpleDateFormat("MM/dd/yyyy"), false));        
    }    
    
}
